home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -in_the_mag- / basics / amos / kyzeramoscode.lha / RT_Moire.AMOS / RT_Moire.amosSourceCode < prev    next >
AMOS Source Code  |  1992-09-03  |  2KB  |  52 lines

  1. ' realtime moire interference by kyz 15/3/94 
  2. ' PS: Since 1994 I have lost the asm source to the machine code, but 
  3. ' it's easy : draw lines from (d2,d3) to all points in steps of 6 around 
  4. ' all four screen edges, using the bitplane pointer in a0, screen width 40 
  5. ' bytes... i used tom kuhn's linedraw routine
  6. '
  7. Unpack 6 To 1
  8. _OPENSCREEN[0,320,202,8,0,0] : X=160 : Y=128 : Screen Display 0,,48,, : Fade 4,0,$444,$444,$888,$444,$777,$777,$FFF
  9. '
  10. M=0
  11. Repeat 
  12.    Inc M : If M=40 Then Screen 1 : Fade 1,,$FFF : Screen 0
  13.    Gosub A
  14. Until Extension_12_03B8 
  15. Fade 2 : While Colour(7) : Gosub A : Wend 
  16. Screen Close 0 : Screen 1 : Fade 1 : Wait 15 : Screen Close 1
  17. End 
  18. A:
  19. Wait Vbl 
  20.  Extension_12_03A6 1
  21. If X1<100 Then DX1=Rnd(10)+1 Else If X1>220 Then DX1=-Rnd(10)-1
  22. If Y1<72 Then DY1=Rnd(10)+1 Else If Y1>128 Then DY1=-Rnd(10)-1
  23. Add X1,DX1 : Add DX2,(X>X1 and DX2>-10)-(X<X1 and DX2<10) : Add X,DX2,0 To 319
  24. Add Y1,DY1 : Add DY2,(Y>Y1 and DY2>-10)-(Y<Y1 and DY2<10) : Add Y,DY2,0 To 199
  25. '
  26. Areg(0)=Logbase(0)+40 : Dreg(2)=X mod 320 : Dreg(3)=Y mod 200 : Call 10
  27. Copy Phybase(1),Phybase(1)+8000 To Logbase(2)
  28. Copy Phybase(0),Phybase(0)+8000 To Logbase(1)
  29. Screen Swap 
  30. Return 
  31. '
  32. Procedure _OPENSCREEN[SCREN,WIDF,HITE,CULOR,REZ,OPTS]
  33.    Default Palette 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  34.    Screen Open SCREN,WIDF,HITE,CULOR,REZ
  35.    Curs Off : Flash Off 
  36.    Pen 1 : Paper 0
  37.    Ink 1,0
  38.    Cls 0 : Rem Blit Clear -1  
  39.    Double Buffer 
  40.    Autoback 0
  41.    Update On 
  42.    Amal Off 
  43.    Synchro Off 
  44.    Bob Off 
  45.    Sprite Off 
  46.    Bob Update Off 
  47.    Sprite Update Off 
  48.    Hide On 
  49.    If OPTS=1 Then Palette 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  50.    If OPTS=2 Then Get Sprite Palette 
  51.    Screen Display SCREN,,166+Ntsc*28-HITE/(2-2*((REZ and 4)=4)),,
  52. End Proc